﻿using UnityEngine;
using System.Collections;

public class FogModifier : MonoBehaviour 
{

	public bool					UseFog = true;
	public bool					PlayAtStart = false;
	public Color				FogColor = Color.black;
	public float				FogDensity = 0.01f;
	public float				FogStart = 0.0f;
	public float				FogEnd = 300.0f;
	public Color				AmbientColor = Color.white;


	void Start()
	{
		if( this.PlayAtStart == true )
		{
			this.ApplyFog();
		}		
	}
	
	public void ApplyFog()
	{
		RenderSettings.fog = this.UseFog;
		RenderSettings.fogColor = this.FogColor;
		RenderSettings.fogDensity = this.FogDensity;
		RenderSettings.fogStartDistance = this.FogStart;
		RenderSettings.fogEndDistance = this.FogEnd;
		RenderSettings.ambientLight = this.AmbientColor;		
	}

}
